package com.aat.dxfy.jdbc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

public class TestPower {

	public static void main(String[] args) {
		String driver = "com.mysql.jdbc.Driver";
		String url = "jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf8";
		String user ="root";
		String passwd ="root";
		try {
			Class.forName(driver);
			Connection con = DriverManager.getConnection(url, user, passwd);
			PreparedStatement ps=con.prepareStatement("select val from kvs");
			ResultSet rs =ps.executeQuery();
			Long l1=System.currentTimeMillis();
			rs.next();
			System.out.println(rs.getString(1));
			Long l2=System.currentTimeMillis();
			System.out.println(l2-l1);
			
			rs.close();
			con.close();
			
		}catch(Exception e){
			e.printStackTrace();
		}
	}

}
